package io.renren.service.impl;

import io.renren.dao.CrlgDao;
import io.renren.entity.CrlgDemoEntity;
import io.renren.entity.ExeclFileEntity;
import io.renren.service.CrlgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;


@Service
public class CrlgServiceImpl implements CrlgService {

    @Autowired
    private CrlgDao crlgDao;

    @Override
    public void saveList(List<CrlgDemoEntity> list, ExeclFileEntity execlFileEntity,String fileName){
        for(int i = 0;i < list.size(); i ++){
            CrlgDemoEntity crlgDemoEntity = list.get(i);
            String province = crlgDemoEntity.getProvince();
            //根据省份来计算运费。先默认申通，
            String city = crlgDemoEntity.getCity();
            crlgDemoEntity.setPerMoney(Double.parseDouble(crlgDemoEntity.getPmoney()));
            crlgDemoEntity.setLowMoney(Double.parseDouble(crlgDemoEntity.getLmoney()));

//            crlgDemoEntity.setPer_money(Double.parseDouble(crlgDemoEntity.getPmoney()));
//            crlgDemoEntity.setLow_money(Double.parseDouble(crlgDemoEntity.getLmoney()));
            crlgDao.save(crlgDemoEntity);

        }





    }




    //查询数据接口
    @Override
    public List<CrlgDemoEntity> queryList(Map<String, Object> map) {
        return crlgDao.queryList(map);
    }

    //



}
